package com.zzyl.mapper;

import com.github.pagehelper.Page;
import com.zzyl.dto.AddNursingLevelDto;
import com.zzyl.dto.NursingPlanSearchDTO;
import com.zzyl.dto.NursingSearchLevelDto;
import com.zzyl.entity.NursingLevel;
import com.zzyl.entity.NursingPlan;
import com.zzyl.vo.NursingSearchLevelVo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface NursingLevelMapper {


    Page<NursingSearchLevelVo> selectAll(NursingSearchLevelDto dto);

    void add(AddNursingLevelDto dto);

    @Select("select nursing_level.*,nursing_plan.plan_name from nursing_level left join nursing_plan on nursing_level.lplan_id = nursing_plan.id where nursing_level.id = #{id};")
    NursingSearchLevelVo selectById(Long id);

    void update(NursingLevel nursingLevel);

    @Delete("delete from nursing_level where id = #{id}")
    void delete(Long id);

    @Update("update nursing_level set status = #{status} where id = #{id}")
    void updateStatus(long id, Integer status);
}